/**
 * 
 */
package mwa.cs.dao;
import java.util.Map;
import mwa.cs.database.Database;

/**
 * A class used for managing allowance
 */
public class AllowanceDAO {
	private Database db;
    /**
     * Instantiate a new object of this class
     * @param database a database
     */
    public AllowanceDAO(Database db) {
        this.db = db;
	}

	// ดึงข้อมูลส่วนลดทหารผ่านศึก
	public Map<String, Object> getAllowance(int pnsiteId) {
		String vaSql = "SELECT type, discount "
				+ "FROM allowance WHERE site_id = ?";
		Map<String, Object> result = db.querySingle(vaSql, pnsiteId);
		if (result != null) {
			return result;
		} else {
			return null;
		}
	}
}
